package cn.net.xyan.blossom.webUI

import cn.net.xyan.blossom.kotlin.AllOpen
import cn.net.xyan.blossom.webUI.service.CatalogService
import cn.net.xyan.blossom.webUI.service.DefaultCatalogServiceImpl
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.boot.autoconfigure.domain.EntityScan
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
import org.springframework.data.jpa.repository.config.EnableJpaRepositories

@AllOpen
@Configuration
@ComponentScan
@EnableJpaRepositories(basePackages = arrayOf("cn.net.xyan.blossom.webUI.dao"))
@EntityScan
class BlossomWebUIConfiguration{

    @Bean
    @ConditionalOnMissingBean
    fun catalogService():CatalogService{
        return DefaultCatalogServiceImpl()
    }
}